import React, { Component } from 'react'
import './ClassifyOperate.css'
let imgBox =''
export default class ClassifyOperate extends Component {
    constructor(props){
        super(props)
        
        if(props.img){
           imgBox =  <div className = 'img-box'>上传</div>
            
        }
        console.log('我执行了',imgBox)
    }
    newClassify = (obj)=>{
        this.props.newClassify(obj)
    }
    render() {
        console.log('render执行了')
        return (
            <div className = 'type'>
                {imgBox}
                <span className = 'type-name'>{this.props.typeName}</span>
                <div className = 'operate-btn'>
                    <button onClick = {()=>{this.newClassify(123)}}>新增子类</button>
                    <button>修改</button>
                    <button>置顶</button>
                    <button>删除</button>
                </div>
            </div>
        )
    }
}

